package main

import (
	"fmt"
	"reflect"
)

type Perple struct {
	Name string `json:"name"`
	Age  int    `json:"age"`
}

func main() {

	//反射获取结构体的标签
	typeof := reflect.TypeOf(Perple{})
	for i := 0; i < typeof.NumField(); i++ {
		field := typeof.Field(i)
		tag := field.Tag.Get("json")
		fmt.Println(tag)
	}

}
